Skip to content

Conversation

@varkor
Copy link
Contributor

@varkor varkor commented Oct 4, 2020

Likely we want more tests, to check the output is correct too: however, I wasn't sure what kind of test we needed, so I just added one similar to that added in #77452 for now.

r? @eddyb

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Oct 4, 2020
@varkor varkor added A-const-generics Area: const generics (parameters and arguments) F-const_generics `#![feature(const_generics)]` S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Oct 4, 2020
@varkor
Copy link
Contributor Author

varkor commented Oct 7, 2020

Blocked on rust-lang/rustc-demangle#39.

@varkor varkor added S-blocked Status: Blocked on something else such as an RFC or other implementation work. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Oct 7, 2020
@varkor varkor force-pushed the mangle-int-char branch 2 times, most recently from bf69efa to 19fca07 Compare October 7, 2020 20:26
@varkor varkor added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-blocked Status: Blocked on something else such as an RFC or other implementation work. labels Oct 7, 2020
@varkor
Copy link
Contributor Author

varkor commented Oct 7, 2020

@eddyb: this is now ready to review.

@varkor varkor force-pushed the mangle-int-char branch 2 times, most recently from 01c4882 to e2de552 Compare October 7, 2020 21:00
Copy link
Member

@eddyb eddyb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

r=me

@varkor
Copy link
Contributor Author

varkor commented Oct 21, 2020

I'll rebase on top of rust-lang/rustc-demangle#41 as soon as it's merged.

@varkor
Copy link
Contributor Author

varkor commented Oct 21, 2020

@bors r=eddyb rollup

@bors
Copy link
Collaborator

bors commented Oct 21, 2020

📌 Commit 878c97e has been approved by eddyb

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Oct 21, 2020
bors added a commit to rust-lang-ci/rust that referenced this pull request Oct 22, 2020
Rollup of 10 pull requests

Successful merges:

 - rust-lang#77420 (Unify const-checking structured errors for `&mut` and `&raw mut`)
 - rust-lang#77554 (Support signed integers and `char` in v0 mangling)
 - rust-lang#77976 (Mark inout asm! operands as used in liveness pass)
 - rust-lang#78009 (Haiku: explicitly set CMAKE_SYSTEM_NAME when cross-compiling)
 - rust-lang#78084 (Greatly improve display for small mobile devices screens)
 - rust-lang#78155 (Fix two small issues in compiler/rustc_lint/src/types.rs)
 - rust-lang#78156 (Fixed build failure of `rustfmt`)
 - rust-lang#78172 (Add test case for rust-lang#77062)
 - rust-lang#78188 (Add tracking issue number for pin_static_ref)
 - rust-lang#78200 (Add `ControlFlow::is_{break,continue}` methods)

Failed merges:

r? `@ghost`
@bors bors merged commit 813066c into rust-lang:master Oct 22, 2020
@rustbot rustbot added this to the 1.49.0 milestone Oct 22, 2020
@varkor varkor mentioned this pull request Oct 22, 2020
6 tasks
bors added a commit that referenced this pull request Nov 11, 2025
…ngling-scheme, r=wesleywiser

sess: default to v0 symbol mangling on nightly

cc #60705 rust-lang/compiler-team#938

Rust's current mangling scheme depends on compiler internals; loses information about generic parameters (and other things) which makes for a worse experience when using external tools that need to interact with Rust symbol names; is inconsistent; and can contain `.` characters which aren't universally supported. Therefore, Rust has defined its own symbol mangling scheme which is defined in terms of the Rust language, not the compiler implementation; encodes information about generic parameters in a reversible way; has a consistent definition; and generates symbols that only use the characters `A-Z`, `a-z`, `0-9`, and `_`.

Support for the new Rust symbol mangling scheme has been added to upstream tools that will need to interact with Rust symbols (e.g. debuggers).

This pull request changes the default symbol mangling scheme from the legacy scheme to the new Rust mangling scheme on nightly.

The following pull requests implemented v0 mangling in rustc (if I'm missing any, let me know):

- #57967
- #63559
- #75675
- #77452
- #77554
- #83767
- #87194
- #87789

Rust's symbol mangling scheme has support in the following external tools:

- `binutils`/`gdb` (GNU `libiberty`)
    - [[PATCH] Move rust_{is_mangled,demangle_sym} to a private libiberty header.
](https://gcc.gnu.org/pipermail/gcc-patches/2019-June/523011.html) committed as gcc-mirror/gcc@979526c
    - [[PATCH] Simplify and generalize rust-demangle's unescaping logic.
](https://gcc.gnu.org/pipermail/gcc-patches/2019-August/527835.html) committed as gcc-mirror/gcc@42bf58b
    - [[PATCH] Remove some restrictions from rust-demangle.
](https://gcc.gnu.org/pipermail/gcc-patches/2019-September/530445.html) committed as gcc-mirror/gcc@e1cb00d
    - [[PATCH] Refactor rust-demangle to be independent of C++ demangling.
](https://gcc.gnu.org/pipermail/gcc-patches/2019-November/533719.html) ([original submission](https://gcc.gnu.org/pipermail/gcc-patches/2019-October/532388.html)) committed as gcc-mirror/gcc@32fc371
    - [[PATCH] Support the new ("v0") mangling scheme in rust-demangle.
](https://gcc.gnu.org/pipermail/gcc-patches/2020-November/558905.html) ([original submission](https://gcc.gnu.org/pipermail/gcc-patches/2020-March/542012.html)) committed as gcc-mirror/gcc@8409649
- `lldb`/`llvm-objdump`/`llvm-nm`/`llvm-symbolizer`/`llvm-cxxfilt`/etc
  - llvm/llvm-project@7310403
  - llvm/llvm-project@c8c2b46
  - llvm/llvm-project@0a2d4f3
- Linux `perf`
- `valgrind`
  - [Update demangler to support Rust v0 name mangling.](https://bugs.kde.org/show_bug.cgi?id=431306)

#85530 (comment) contains a summary of the most recent crater run of the v0 mangling, and the remaining issues from that were fixed by #87194 (confirmed by follow-up crater run, #85530 (comment)).

`@rustbot` label +T-compiler
r? `@michaelwoerister`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-const-generics Area: const generics (parameters and arguments) F-const_generics `#![feature(const_generics)]` S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants